<?php
include "../../../lib/list.php";
if($_GET['date'])$date = $_GET['date'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head>
<link rel="stylesheet" href="../../../css/list.css" type="text/css"></link>
<link rel="stylesheet" href="../../../css/insert.css" type="text/css"></link>
<link rel="stylesheet" href="../../../css/table.blue.sorter.css" type="text/css" media="print, projection, screen"></link>
<link rel="stylesheet" href="../../../css/jquery.tablesorter.pager.css"	type="text/css" media="print, projection, screen"></link>

<script type="text/javascript" src="../../../js/list.js"></script>
<script type="text/javascript" src="../../../js/jquery-1.2.6.js"></script>
<script type="text/javascript" src="../../../js/calendarDateInput.js"></script>
</head>
<body>
<div style="width: 1024px; padding: 10px;">
		<div
			style="border-bottom: 1px solid #e8e8e8; text-align: left; font-size: 12px; margin-bottom: 12px; color: #9a9a9a">:::
			재고 관리&nbsp;⇒&nbsp;입고 결함품 입력 이력&nbsp;⇒&nbsp;상세보기</div>
<table cellspacing="1" class="tablesorter" style="width:600px;float:right;">
				<thead>
					<tr>
						<th>barcode</th>
						<th>상품 명</th>
						<th>가격</th>
						<th>수량</th>
					</tr>
					</thead>
					<tbody>
					<?php 
					$query = "SELECT * FROM uatp_prdreview WHERE date = '$date'";
					$result = DBquery($query);
					while($list= mysql_fetch_array($result)){
					$qry = "SELECT * FROM uatp_product WHERE no = $list[p_no]";
					$product = DBarray($qry);
						$total_price += $list['price'];
						$total_count += $list['count'];
					?>
					<tr>
					<td style="width:150px;"><input type='text' name='inbarcode' value="<?=$product['barcode']?>" readonly class="insert" style="width:150px;"/></td>
					<td><input type='text' size='40' name='productname' value="<?=$product['productname']?>" readonly class="insert"/>
						<input type="hidden" name="no" value=""/></td>
					<td style="width:120px;">
					<input type='text' size='9' name='price' value='<?=$list['price']?>' readonly class="insert" style="text-align:right;width:100px;"/>￥</td>
					<td style="width:50px;">
					<input type='text' name='count' value='<?=$list['count']?>' readonly size='3' class="insert" style="text-align:right">
					</input>개</td>
					</tr>
					<?php
					} ?>
					</tbody>
					<tfoot>
					<tr>
						<th colspan=2></th>
						<th style="text-align:right;"><?=$total_price?>￥</th>
						<th style="text-align:right;"><?=$total_count?>개</th>
					</tr>
					</tfoot>
					</table>	
						<?
						$qry = "SELECT uatp_shopinfo.name AS 'shopname', uatp_prdreview.no,
								uatp_prdreview.count, uatp_prdreview.unit, uatp_prdgroup.date, uatp_prdgroup.note,
								uatp_prdreview.admin_name AS 'name'
								FROM uatp_prdreview
								INNER JOIN uatp_shopinfo ON uatp_prdreview.s_no = uatp_shopinfo.no
								INNER JOIN uatp_prdgroup ON uatp_prdreview.date = uatp_prdgroup.date
								WHERE uatp_prdreview.date='$date' LIMIT 0 , 1";
						$info = DBarray($qry);
						?>
						<div style="width:400px;float:left;">		 <table class="entry fixed H_15px" summary="재고-입력상단부">
						     <tr>
							  <th style="width:20%">점포명</th>
							  <td colspan="3"><?=$info['shopname']?></td>
						</tr>
						<tr>
						      <th style="width:20%">관리자</th>
						      <td><?=$info['name']?></td>
						<th style="width:20%">날짜</th>
						<td><input type='text' name='date' value="<?=date('Y-m-d',strtotime($info['date']))?>" readonly class="insert" style="width:100px;"/></td>
						</tr>
						<tr>
						<th style="width:20%">내용</th>
						<td colspan="3"><?=$info['note']?></td>
						</tr>
						</table>
						</div>				
						<div style="padding-top:15px;width:400px;float:right;">
						<center><a href="javascript:openBrWindow('iprint.php?date=<?=$date?>','mbid','scrollbars=no,width=700,height=600');" class="button blue small" style="width:80px;">&nbsp;출력하기&nbsp;</a>
								<a href="javascript:history.go(-1)" class="button white small" style="width:80px;">&nbsp;뒤로가기&nbsp;</a>
						</center>
						</div>	
					</div>
</body>
</html>